package com.sc.nft.enums;

import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum WalletDetailTypeEnum {

    INCOME(1, "收益"),
    WITHDRAW(2, "提现"),
    RECHARGE(3, "充值"),
    CONSUMPTION(4, "消费"),
    REFUND(5, "退费"),
    BACKSTAGE_ADD(6, "后台加款"),
    BACKSTAGE_SUB(7, "后台扣款"),
    SECOND_CONSUMPTION(8, "二级消费"),
    CONSIGNMENT_SALES_DISCOUNT(9, "寄售手续费返现"),
    NFR_BENEFITS(10, "NFR福利包"),
    DISASSEMBLE_RED_ENVELOPE(11, "拆配"),
    RED_PACKET_DEDUCTION(12, "MT原石抵扣"),
    SERVICE_CHARGE_SHARE_OUT_BONUS(13, "领主手续费分润"),
    SECOND_SALE(14, "二级售卖"),
    CASTELLAN_CASH_BACK(15, "城主MT原石返现"),
    RESIDENT_CASH_BACK(16, "居民MT原石返现"),
    TRANSFER_HUIFU(17, "转账汇付"),
    TRANSFER_SAND(18, "转账衫德"),
    DEPOSIT_PAYMENT(19, "保证金充值"),
    DEPOSIT_RELEASED(20, "保证金退款"),
    DAO_CHARGE_SHARE(21, "品牌手续费分润"),
    URBAN_SERVICE_CENTER_INCREASES_THE_LEVEL_OF_INCOME(22, "城市服务中心推广分润"),
    IP_CONSUMPTION(23, "IP商城消费"),
    IP_MALL_DIRECT_PURCHASE(24, "IP商城-直推收益"),
    IP_MALL_INTERIM_PURCHASE(25, "IP商城-间推收益"),
    IP_MALL_CITY_SERVER(26, "IP商城-城市服务中心收益"),
    IP_MALL_ORDER_REFUND(27, "IP商城订单退款"),
    IP_MALL_NETWORK_REVENUE(28, "IP商城网点收益"),
    TRANSFER_LL(29, "转账连连"),
    DECOMPOSE(30, "分解MT原石"),
    RANKING_BONUS(31, "榜单奖励"),
    ADD_WISH(32, "分润增加购物金"),
    WISH_USED(33, "购物金抵扣"),
    CARVE_UP(34, "瓜分活动"),
    COPYRIGHT(35, "版权收益"),
    SUPPLY_CHAIN(36, "供应商推荐"),
    DAO_TRANSFER_IN(37, "dao转入"),
    DAO_TRANSFER_OUT(38, "dao转出"),
    TRANSFER_FAIL(39, "转账退回"),
    SHARE_GROUP_REWARDS(40, "分享购成团奖励"),
    TRANSFER_TO_DAO(41, "转出至企业钱包"),
    TRANSFER_HNA(42, "转账新生"),
    ITEM_TRANSFER_CREDIT(43, "道具转赠抵扣"),
    ITEM_TRANSFER(44, "道具转赠"),
    NFT_TRANSFER_CREDIT(45, "NFT转增抵扣"),
    NFT_TRANSFER(46, "NFT转赠"),
    PROPS_SALES(47, "虚拟道具售卖"),
    GIVE_MATE_WALLET(48, "转增到玛特钱包"),
    ROUGH_STONE_PURCHASE(49, "余额购买原石"),
    BUSINESS_CARD(50, "余额购买名片"),
    WANT_BUY_SCROLL_PRE_PAY(51, "求购卷轴预付款"),
    COLLECTIVE_PAY(52, "集售支付"),
    COLLECTIVE_SELL(53, "集售卖出"),
    ORDER_GAS_SHARE(54, "上链费分红"),
    MALL_REFUND(55, "购物金退款"),
    DIRECT_PURCHASE(56, "直推"),
    PLANT_LESS(57, "平台结余"),
    TRANSACTION_POOL_PAYMENT(58, "交易池支付"),
    TRANSACTION_POOL_SETTLE_AN_ACCOUNT(59, "交易池结算"),
    TRANSACTION_POOL_DESTRUCTION(60, "交易池销毁"),
    GAS_ECOLOGY_CAST_EXPEND(61, "生态池铸造上链费"),
    GAS_GIVE(62, "转赠上链费"),
    GAS_ECOLOGY_REFORGE_EXPEND(63, "生态池重铸上链费"),
    CDK_EXCHANGE(64, "CDK兑换上链费"),
    WANT_BUY_COLLECTION_PAY(65, "求购单藏品支付"),
    WANT_BUY_PROPS_PAY(66, "求购单道具支付"),
    WANT_BUY_COLLECTION_REFUND(67, "求购单藏品返还"),
    WANT_BUY_PROPS_REFUND(68, "求购单道具返还"),
    GAS_CONVERSION(69, "藏品兑换上链费"),
    GAS_PRIVILEGE(70, "合成上链费"),
    ;

    @EnumValue
    private int code;

    private String description;

    public static WalletDetailTypeEnum of(int code) {
        return ArrayUtil.firstMatch(item -> item.getCode() == code, WalletDetailTypeEnum.values());
    }

}
